package com.zhongxi.guoyuan.utils;

import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;

/**
 * Created by Administrator on 2018/1/9.
 */

public class ViewUtils {
    /**
     * 从父view中移除该view
     *
     * @param view
     */
    public static void removeFromParent(View view) {
        if (view != null) {
            ViewParent parent = view.getParent();
            if (parent != null && parent instanceof ViewGroup) {
                ViewGroup viewGroup = (ViewGroup) parent;
                viewGroup.removeView(view);
            }
        }
    }
}
